#ifndef EDITORCORE_PROPERTYVALUE_H
#define EDITORCORE_PROPERTYVALUE_H

#include <string>
#include "EditorCore/Property/PropertyValueType.h"

namespace editor_core {

	class PropertyValue
	{
	private:
		union Union {
			bool m_bool;
			int m_int;
			float m_float;
		};

		PropertyValue( PropertyValueType type, Union value );
		PropertyValue( PropertyValueType type, std::string value );

	public:
		PropertyValue( const PropertyValue& other );
		PropertyValue( bool value );
		PropertyValue( int value );
		PropertyValue( float value );

		inline PropertyValueType GetType() const { return m_type; }

		bool GetBool() const;
		void SetBool( bool value );

		int GetInt() const;
		void SetInt( int value );

		float GetFloat() const;
		void SetFloat( float value );

		std::string GetString() const;
		void SetString( std::string value );

		std::string GetFile() const;
		void SetFile( std::string value );

		PropertyValue& operator=( const PropertyValue& other );

		PropertyValue& operator=( bool b );
		PropertyValue& operator=( int i );
		PropertyValue& operator=( float f );

		static PropertyValue CreateBoolValue( bool value );
		static PropertyValue CreateIntValue( int value );
		static PropertyValue CreateFloatValue( float value );
		static PropertyValue CreateStringValue( std::string value );
		static PropertyValue CreateFileValue( std::string value );

	private:
		PropertyValueType m_type;
		Union m_union;
		std::string m_string;
	};

	bool operator== ( const PropertyValue& a, const PropertyValue& b );
	bool operator!= ( const PropertyValue& a, const PropertyValue& b );

}
#endif
